"""
封装薪资预测模型
"""
import pickle # 模型保存与加载模块
import numpy as np
import pandas as pd


class SalaryPredictModel:
    def __init__(self):
        with open('model.pickle','rb') as f:
            self.model = pickle.load(f)


    def predict_myself(self, exps):
        # exps = pd.DataFrame(exps)
        exps = np.array(exps).reshape(-1,1) # -1为自适应
        return self.model.predict(exps)
        # predict_value = []
        # for i in param:
        #     print(i)
        #     predict_value.append(self.model.predict(i))
        # return predict_value



s01 = SalaryPredictModel()
print(s01.predict_myself([1.1,2.2]))